simplify tests
authorAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 12 May 2016 15:23:53 +0000 (18:23 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Thu, 12 May 2016 19:54:22 +0000 (22:54 +0300)
remove ADDING, REMOVING, DOCTEST, DOWNLOADING, PACKAGING, UPLOADING,
VERIFYING, ARCHIVING, INSTALLING, REPLACING constants

tests/support/mod.rs
tests/test_cargo_cfg.rs
tests/test_cargo_compile_custom_build.rs
tests/test_cargo_cross_compile.rs
tests/test_cargo_install.rs
tests/test_cargo_overrides.rs
tests/test_cargo_package.rs
tests/test_cargo_publish.rs
tests/test_cargo_registry.rs
tests/test_cargo_test.rs

index 3ba8be881f5a312c9719461821d15ec15255a740..f42057b68801215f0bfc7762ba67294c088ba3b9 100644 (file)
@@ -682,14 +682,3 @@ fn substitute_macros(input: &str) -> String {
     }
     return result;
 }
-
-pub static ADDING:      &'static str = "      Adding";
-pub static REMOVING:    &'static str = "    Removing";
-pub static DOCTEST:     &'static str = "   Doc-tests";
-pub static PACKAGING:   &'static str = "   Packaging";
-pub static DOWNLOADING: &'static str = " Downloading";
-pub static UPLOADING:   &'static str = "   Uploading";
-pub static VERIFYING:   &'static str = "   Verifying";
-pub static ARCHIVING:   &'static str = "   Archiving";
-pub static INSTALLING:  &'static str = "  Installing";
-pub static REPLACING:   &'static str = "   Replacing";
index 9e1971107b764511a103756a302228bb5676dcae..7ce0e02b1652fe4b91355c91e2b5f794d50180d3 100644 (file)
@@ -4,7 +4,7 @@ use std::fmt;
 use cargo::util::{Cfg, CfgExpr};
 use hamcrest::assert_that;
 
-use support::{project, execs, DOWNLOADING};
+use support::{project, execs};
 use support::registry::Package;
 
 macro_rules! c {
@@ -213,12 +213,12 @@ test!(works_through_the_registry {
     assert_that(p.cargo_process("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry [..]
-{downloading} [..]
-{downloading} [..]
+[DOWNLOADING] [..]
+[DOWNLOADING] [..]
 [COMPILING] foo v0.1.0 ([..])
 [COMPILING] bar v0.1.0 ([..])
 [COMPILING] a v0.0.1 ([..])
-", downloading = DOWNLOADING)));
+")));
 });
 
 test!(bad_target_spec {
index b88963de4ecf9c0ffd4011a4caeded6b6d57e61b..125e0a34158290de31ea413ef2c8292da2743f16 100644 (file)
@@ -2,7 +2,6 @@ use std::fs::{self, File};
 use std::io::prelude::*;
 
 use support::{project, execs};
-use support::{DOCTEST};
 use support::paths::CargoPathExt;
 use hamcrest::{assert_that, existing_file, existing_dir};
 
@@ -482,14 +481,14 @@ running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 [RUNNING] `rustdoc --test [..]`
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-", doctest = DOCTEST)));
+")));
 
     println!("doc");
     assert_that(p.cargo("doc").arg("-v"),
@@ -1331,7 +1330,7 @@ test test_bar ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 [RUNNING] [..] --cfg foo[..]
 
 running 1 test
@@ -1339,7 +1338,7 @@ test foo_0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", dir = p.url(), doctest = DOCTEST)));
+", dir = p.url())));
 });
 
 test!(cfg_doc {
@@ -1445,7 +1444,7 @@ test test_bar ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 [RUNNING] [..] --cfg foo[..]
 
 running 1 test
@@ -1453,7 +1452,7 @@ test foo_0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", dir = p.url(), doctest = DOCTEST)));
+", dir = p.url())));
 });
 
 test!(cfg_override_doc {
index 3b37634191824b1d42e045d87c189466a2fb399f..51e406a5ab8b20a7c443985f0d8770f15041e938 100644 (file)
@@ -1,7 +1,6 @@
 use std::env;
 
 use support::{project, execs, basic_bin_manifest};
-use support::{DOCTEST};
 use hamcrest::{assert_that, existing_file};
 use cargo::util::process;
 
@@ -505,14 +504,14 @@ running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 1 test
 test _0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", foo = p.url(), doctest = DOCTEST);
+", foo = p.url());
 
     assert_that(p.cargo_process("test"),
                 execs().with_status(0)
index 1a99fcc43b6643ee16b4bb79aea5d02c29e4f61e..5ceeab2439401ca28b4018e222dc69a5621e09a5 100644 (file)
@@ -8,7 +8,6 @@ use cargo::util::ProcessBuilder;
 use hamcrest::{assert_that, existing_file, is_not, Matcher, MatchResult};
 
 use support::{project, execs};
-use support::{DOWNLOADING, INSTALLING, REPLACING, REMOVING};
 use support::paths;
 use support::registry::Package;
 use support::git;
@@ -85,12 +84,10 @@ test!(pick_max_version {
     assert_that(cargo_process("install").arg("foo"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `[..]`
-{downloading} foo v0.0.2 (registry file://[..])
+[DOWNLOADING] foo v0.0.2 (registry file://[..])
 [COMPILING] foo v0.0.2 (registry file://[..])
-{installing} {home}[..]bin[..]foo[..]
+[INSTALLING] {home}[..]bin[..]foo[..]
 ",
-        downloading = DOWNLOADING,
-        installing = INSTALLING,
         home = cargo_home().display())));
     assert_that(cargo_home(), has_installed_exe("foo"));
 });
@@ -417,9 +414,8 @@ test!(install_force {
     assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
                 execs().with_status(0).with_stdout(&format!("\
 [COMPILING] foo v0.2.0 ([..])
-{replacing} {home}[..]bin[..]foo[..]
+[REPLACING] {home}[..]bin[..]foo[..]
 ",
-        replacing = REPLACING,
         home = cargo_home().display())));
 
     assert_that(cargo_process("install").arg("--list"),
@@ -458,11 +454,9 @@ test!(install_force_partial_overlap {
     assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
                 execs().with_status(0).with_stdout(&format!("\
 [COMPILING] foo v0.2.0 ([..])
-{installing} {home}[..]bin[..]foo-bin3[..]
-{replacing} {home}[..]bin[..]foo-bin2[..]
+[INSTALLING] {home}[..]bin[..]foo-bin3[..]
+[REPLACING] {home}[..]bin[..]foo-bin2[..]
 ",
-        installing = INSTALLING,
-        replacing = REPLACING,
         home = cargo_home().display())));
 
     assert_that(cargo_process("install").arg("--list"),
@@ -508,9 +502,8 @@ test!(install_force_bin {
                     .arg(p.root()),
                 execs().with_status(0).with_stdout(&format!("\
 [COMPILING] foo v0.2.0 ([..])
-{replacing} {home}[..]bin[..]foo-bin2[..]
+[REPLACING] {home}[..]bin[..]foo-bin2[..]
 ",
-        replacing = REPLACING,
         home = cargo_home().display())));
 
     assert_that(cargo_process("install").arg("--list"),
@@ -562,9 +555,8 @@ test!(git_repo {
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] git repository `[..]`
 [COMPILING] foo v0.1.0 ([..])
-{installing} {home}[..]bin[..]foo[..]
+[INSTALLING] {home}[..]bin[..]foo[..]
 ",
-        installing = INSTALLING,
         home = cargo_home().display())));
     assert_that(cargo_home(), has_installed_exe("foo"));
     assert_that(cargo_home(), has_installed_exe("foo"));
@@ -627,17 +619,17 @@ test!(uninstall_piecemeal {
     assert_that(cargo_home(), has_installed_exe("bar"));
 
     assert_that(cargo_process("uninstall").arg("foo").arg("--bin=bar"),
-                execs().with_status(0).with_stdout(&format!("\
-{removing} [..]bar[..]
-", removing = REMOVING)));
+                execs().with_status(0).with_stdout("\
+[REMOVING] [..]bar[..]
+"));
 
     assert_that(cargo_home(), has_installed_exe("foo"));
     assert_that(cargo_home(), is_not(has_installed_exe("bar")));
 
     assert_that(cargo_process("uninstall").arg("foo").arg("--bin=foo"),
-                execs().with_status(0).with_stdout(&format!("\
-{removing} [..]foo[..]
-", removing = REMOVING)));
+                execs().with_status(0).with_stdout("\
+[REMOVING] [..]foo[..]
+"));
     assert_that(cargo_home(), is_not(has_installed_exe("foo")));
 
     assert_that(cargo_process("uninstall").arg("foo"),
@@ -691,9 +683,9 @@ test!(do_not_rebuilds_on_local_install {
     assert_that(p.cargo_process("build").arg("--release"),
                 execs().with_status(0));
     assert_that(cargo_process("install").arg("--path").arg(p.root()),
-                execs().with_status(0).with_stdout(&format!("\
-{installing} [..]
-", installing = INSTALLING)).with_stderr("\
+                execs().with_status(0).with_stdout("\
+[INSTALLING] [..]
+").with_stderr("\
 warning: be sure to add `[..]` to your PATH to be able to run the installed binaries
 "));
 
index 3d8eb1097c298331327028bacb4a2c34f5aaecbb..b73ea6d5e580d728f5dbb09af43bb1bfb0ac2f26 100644 (file)
@@ -1,7 +1,7 @@
 use hamcrest::assert_that;
 
 use support::registry::{registry, Package};
-use support::{execs, project, DOWNLOADING};
+use support::{execs, project};
 use support::git;
 use support::paths;
 
@@ -138,11 +138,11 @@ test!(transitive {
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `file://[..]`
 [UPDATING] git repository `[..]`
-{downloading} bar v0.2.0 (registry [..])
+[DOWNLOADING] bar v0.2.0 (registry [..])
 [COMPILING] foo v0.1.0 (file://[..])
 [COMPILING] bar v0.2.0 (registry [..])
 [COMPILING] local v0.0.1 (file://[..])
-", downloading = DOWNLOADING)));
+")));
 
     assert_that(p.cargo("build"), execs().with_status(0).with_stdout(""));
 });
@@ -284,13 +284,13 @@ test!(use_a_spec_to_select {
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `file://[..]`
 [UPDATING] git repository `[..]`
-{downloading} [..]
-{downloading} [..]
+[DOWNLOADING] [..]
+[DOWNLOADING] [..]
 [COMPILING] [..]
 [COMPILING] [..]
 [COMPILING] [..]
 [COMPILING] local v0.0.1 (file://[..])
-", downloading = DOWNLOADING)));
+")));
 });
 
 test!(override_adds_some_deps {
@@ -329,11 +329,11 @@ test!(override_adds_some_deps {
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `file://[..]`
 [UPDATING] git repository `[..]`
-{downloading} foo v0.1.1 (registry [..])
+[DOWNLOADING] foo v0.1.1 (registry [..])
 [COMPILING] foo v0.1.1 (registry [..])
 [COMPILING] bar v0.1.0 ([..])
 [COMPILING] local v0.0.1 (file://[..])
-", downloading = DOWNLOADING)));
+")));
 
     assert_that(p.cargo("build"), execs().with_status(0).with_stdout(""));
 
index f608fbbcb7951ad1d52d4966db3488dcbae655e8..423a717bfc9a954315943d76fbf4be29c30bbb73 100644 (file)
@@ -7,7 +7,6 @@ use git2;
 use tar::Archive;
 
 use support::{project, execs, paths, git, path2url};
-use support::{PACKAGING, VERIFYING, ARCHIVING};
 use hamcrest::{assert_that, existing_file};
 
 fn setup() {
@@ -31,12 +30,10 @@ test!(simple {
 
     assert_that(p.cargo_process("package"),
                 execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
 [COMPILING] foo v0.0.1 ({dir}[..])
 ",
-        packaging = PACKAGING,
-        verifying = VERIFYING,
         dir = p.url())));
     assert_that(&p.root().join("target/package/foo-0.0.1.crate"), existing_file());
     assert_that(p.cargo("package").arg("-l"),
@@ -75,12 +72,10 @@ test!(metadata_warning {
         "#);
     assert_that(p.cargo_process("package"),
                 execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
 [COMPILING] foo v0.0.1 ({dir}[..])
 ",
-        packaging = PACKAGING,
-        verifying = VERIFYING,
         dir = p.url()))
                 .with_stderr("\
 warning: manifest has no description, license, license-file, documentation, \
@@ -100,12 +95,10 @@ http://doc.crates.io/manifest.html#package-metadata for more info."));
         "#);
     assert_that(p.cargo_process("package"),
                 execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
 [COMPILING] foo v0.0.1 ({dir}[..])
 ",
-        packaging = PACKAGING,
-        verifying = VERIFYING,
         dir = p.url()))
                 .with_stderr("\
 warning: manifest has no description, documentation, homepage or repository. See \
@@ -126,12 +119,10 @@ http://doc.crates.io/manifest.html#package-metadata for more info."));
         "#);
     assert_that(p.cargo_process("package"),
                 execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
 [COMPILING] foo v0.0.1 ({dir}[..])
 ",
-        packaging = PACKAGING,
-        verifying = VERIFYING,
         dir = p.url())));
 });
 
@@ -161,24 +152,20 @@ test!(package_verbose {
 
     println!("package main repo");
     assert_that(cargo.clone().arg("package").arg("-v").arg("--no-verify"),
-                execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-",
-        packaging = PACKAGING,
-        archiving = ARCHIVING)));
+                execs().with_status(0).with_stdout("\
+[PACKAGING] foo v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
 
     println!("package sub-repo");
     assert_that(cargo.arg("package").arg("-v").arg("--no-verify")
                      .cwd(p.root().join("a")),
-                execs().with_status(0).with_stdout(&format!("\
-{packaging} a v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-",
-        packaging = PACKAGING,
-        archiving = ARCHIVING)));
+                execs().with_status(0).with_stdout("\
+[PACKAGING] a v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
 });
 
 test!(package_verification {
@@ -196,12 +183,10 @@ test!(package_verification {
                 execs().with_status(0));
     assert_that(p.cargo("package"),
                 execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
 [COMPILING] foo v0.0.1 ({dir}[..])
 ",
-        packaging = PACKAGING,
-        verifying = VERIFYING,
         dir = p.url())));
 });
 
@@ -221,11 +206,11 @@ test!(exclude {
         .file("src/bar.txt", "");
 
     assert_that(p.cargo_process("package").arg("--no-verify").arg("-v"),
-                execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-", packaging = PACKAGING, archiving = ARCHIVING)));
+                execs().with_status(0).with_stdout("\
+[PACKAGING] foo v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
 });
 
 test!(include {
@@ -245,12 +230,12 @@ test!(include {
         .file("src/bar.txt", ""); // should be ignored when packaging
 
     assert_that(p.cargo_process("package").arg("--no-verify").arg("-v"),
-                execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-{archiving} [..]
-", packaging = PACKAGING, archiving = ARCHIVING)));
+                execs().with_status(0).with_stdout("\
+[PACKAGING] foo v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
 });
 
 test!(package_lib_with_bin {
@@ -284,16 +269,14 @@ test!(package_new_git_repo {
 
     assert_that(::cargo_process().arg("package").cwd(p.root())
                  .arg("--no-verify").arg("-v"),
-                execs().with_status(0).with_stdout(&format!("\
-{packaging} foo v0.0.1 ([..])
-{archiving} [..]
-{archiving} [..]
-", packaging = PACKAGING, archiving = ARCHIVING)));
+                execs().with_status(0).with_stdout("\
+[PACKAGING] foo v0.0.1 ([..])
+[ARCHIVING] [..]
+[ARCHIVING] [..]
+"));
 });
 
 test!(package_git_submodule {
-    use std::str::from_utf8;
-
     let project = git::new("foo", |project| {
         project.file("Cargo.toml", r#"
                     [project]
@@ -319,9 +302,9 @@ test!(package_git_submodule {
     repository.reset(&repository.revparse_single("HEAD").unwrap(),
                      git2::ResetType::Hard, None).unwrap();
 
-    let result = project.cargo("package").arg("--no-verify").arg("-v").exec_with_output().unwrap();
-    assert!(result.status.success());
-    assert!(from_utf8(&result.stdout).unwrap().contains(&format!("{} bar/Makefile", ARCHIVING)));
+    assert_that(::cargo_process().arg("package").cwd(project.root())
+                 .arg("--no-verify").arg("-v"),
+                execs().with_status(0).with_stdout_contains("[ARCHIVING] bar/Makefile"));
 });
 
 test!(no_duplicates_from_modified_tracked_files {
@@ -372,12 +355,10 @@ test!(ignore_nested {
 
     assert_that(p.cargo_process("package"),
                 execs().with_status(0).with_stdout(&format!("\
-{packaging} nested v0.0.1 ({dir})
-{verifying} nested v0.0.1 ({dir})
+[PACKAGING] nested v0.0.1 ({dir})
+[VERIFYING] nested v0.0.1 ({dir})
 [COMPILING] nested v0.0.1 ({dir}[..])
 ",
-        packaging = PACKAGING,
-        verifying = VERIFYING,
         dir = p.url())));
     assert_that(&p.root().join("target/package/nested-0.0.1.crate"), existing_file());
     assert_that(p.cargo("package").arg("-l"),
index d6b2fc7e8969160515ce7d5ef88a5ee0cae139cc..ae164feb3807bd468f14cc9f5a836dbd6c0e4435 100644 (file)
@@ -8,7 +8,6 @@ use tar::Archive;
 use url::Url;
 
 use support::{project, execs};
-use support::{PACKAGING, UPLOADING};
 use support::paths;
 use support::git::repo;
 
@@ -52,11 +51,9 @@ test!(simple {
     assert_that(p.cargo_process("publish").arg("--no-verify"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `{reg}`
-{packaging} foo v0.0.1 ({dir})
-{uploading} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[UPLOADING] foo v0.0.1 ({dir})
 ",
-        uploading = UPLOADING,
-        packaging = PACKAGING,
         dir = p.url(),
         reg = registry())));
 
index 254007c7bf02b2dcb26ff6f31cab86f3c4461f9b..3dbc51ca0a7a817f76e97e8d5b28426631c41456 100644 (file)
@@ -2,7 +2,6 @@ use std::fs::{self, File};
 use std::io::prelude::*;
 
 use support::{project, execs};
-use support::{DOWNLOADING, PACKAGING, VERIFYING, ADDING, REMOVING};
 use support::paths::{self, CargoPathExt};
 use support::registry::{self, Package};
 use support::git;
@@ -30,11 +29,10 @@ test!(simple {
     assert_that(p.cargo_process("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `{reg}`
-{downloading} bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry file://[..])
 [COMPILING] bar v0.0.1 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir})
 ",
-        downloading = DOWNLOADING,
         dir = p.url(),
         reg = registry::registry())));
 
@@ -68,13 +66,12 @@ test!(deps {
     assert_that(p.cargo_process("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `{reg}`
-{downloading} [..] v0.0.1 (registry file://[..])
-{downloading} [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
 [COMPILING] baz v0.0.1 (registry file://[..])
 [COMPILING] bar v0.0.1 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir})
 ",
-        downloading = DOWNLOADING,
         dir = p.url(),
         reg = registry::registry())));
 });
@@ -194,11 +191,10 @@ version required: >= 0.0.0
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `{reg}`
-{downloading} notyet v0.0.1 (registry file://[..])
+[DOWNLOADING] notyet v0.0.1 (registry file://[..])
 [COMPILING] notyet v0.0.1 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir})
 ",
-        downloading = DOWNLOADING,
         dir = p.url(),
         reg = registry::registry())));
 });
@@ -244,18 +240,13 @@ version required: ^0.0.1
 
     assert_that(p.cargo("package"),
                 execs().with_status(0).with_stdout(format!("\
-{packaging} foo v0.0.1 ({dir})
-{verifying} foo v0.0.1 ({dir})
+[PACKAGING] foo v0.0.1 ({dir})
+[VERIFYING] foo v0.0.1 ({dir})
 [UPDATING] registry `[..]`
-{downloading} notyet v0.0.1 (registry file://[..])
+[DOWNLOADING] notyet v0.0.1 (registry file://[..])
 [COMPILING] notyet v0.0.1 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir}[..])
-",
-    packaging = PACKAGING,
-    verifying = VERIFYING,
-    downloading = DOWNLOADING,
-    dir = p.url(),
-)));
+", dir = p.url())));
 });
 
 test!(lockfile_locks {
@@ -277,10 +268,10 @@ test!(lockfile_locks {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `[..]`
-{downloading} bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry file://[..])
 [COMPILING] bar v0.0.1 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
 
     p.root().move_into_the_past().unwrap();
@@ -310,12 +301,12 @@ test!(lockfile_locks_transitively {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `[..]`
-{downloading} [..] v0.0.1 (registry file://[..])
-{downloading} [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
 [COMPILING] baz v0.0.1 (registry file://[..])
 [COMPILING] bar v0.0.1 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
 
     p.root().move_into_the_past().unwrap();
@@ -348,12 +339,12 @@ test!(yanks_are_not_used {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `[..]`
-{downloading} [..] v0.0.1 (registry file://[..])
-{downloading} [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
 [COMPILING] baz v0.0.1 (registry file://[..])
 [COMPILING] bar v0.0.1 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
 });
 
@@ -441,8 +432,8 @@ test!(update_with_lockfile_if_packages_missing {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `[..]`
-{downloading} bar v0.0.1 (registry file://[..])
-", downloading = DOWNLOADING)));
+[DOWNLOADING] bar v0.0.1 (registry file://[..])
+")));
 });
 
 test!(update_lockfile {
@@ -478,10 +469,10 @@ test!(update_lockfile {
     println!("0.0.2 build");
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
-{downloading} [..] v0.0.2 (registry file://[..])
+[DOWNLOADING] [..] v0.0.2 (registry file://[..])
 [COMPILING] bar v0.0.2 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
 
     println!("0.0.3 update");
@@ -495,10 +486,10 @@ test!(update_lockfile {
     println!("0.0.3 build");
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
-{downloading} [..] v0.0.3 (registry file://[..])
+[DOWNLOADING] [..] v0.0.3 (registry file://[..])
 [COMPILING] bar v0.0.3 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
 
    println!("new dependencies update");
@@ -506,21 +497,21 @@ test!(update_lockfile {
    Package::new("spam", "0.2.5").publish();
    assert_that(p.cargo("update")
                 .arg("-p").arg("bar"),
-               execs().with_status(0).with_stdout(&format!("\
+               execs().with_status(0).with_stdout("\
 [UPDATING] registry `[..]`
 [UPDATING] bar v0.0.3 (registry file://[..]) -> v0.0.4
-{adding} spam v0.2.5 (registry file://[..])
-", adding = ADDING)));
+[ADDING] spam v0.2.5 (registry file://[..])
+"));
 
    println!("new dependencies update");
    Package::new("bar", "0.0.5").publish();
    assert_that(p.cargo("update")
                 .arg("-p").arg("bar"),
-               execs().with_status(0).with_stdout(&format!("\
+               execs().with_status(0).with_stdout("\
 [UPDATING] registry `[..]`
 [UPDATING] bar v0.0.4 (registry file://[..]) -> v0.0.5
-{removing} spam v0.2.5 (registry file://[..])
-", removing = REMOVING)));
+[REMOVING] spam v0.2.5 (registry file://[..])
+"));
 });
 
 test!(dev_dependency_not_used {
@@ -543,10 +534,10 @@ test!(dev_dependency_not_used {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `[..]`
-{downloading} [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry file://[..])
 [COMPILING] bar v0.0.1 (registry file://[..])
 [COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
 });
 
@@ -607,11 +598,11 @@ test!(updating_a_dep {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `[..]`
-{downloading} bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry file://[..])
 [COMPILING] bar v0.0.1 (registry file://[..])
 [COMPILING] a v0.0.1 ({dir}/a)
 [COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
 
     File::create(&p.root().join("a/Cargo.toml")).unwrap().write_all(br#"
@@ -629,11 +620,11 @@ test!(updating_a_dep {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `[..]`
-{downloading} bar v0.1.0 (registry file://[..])
+[DOWNLOADING] bar v0.1.0 (registry file://[..])
 [COMPILING] bar v0.1.0 (registry file://[..])
 [COMPILING] a v0.0.1 ({dir}/a)
 [COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
 });
 
@@ -673,11 +664,11 @@ test!(git_and_registry_dep {
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] [..]
 [UPDATING] [..]
-{downloading} a v0.0.1 (registry file://[..])
+[DOWNLOADING] a v0.0.1 (registry file://[..])
 [COMPILING] a v0.0.1 (registry [..])
 [COMPILING] b v0.0.1 ([..])
 [COMPILING] foo v0.0.1 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
     p.root().move_into_the_past().unwrap();
 
@@ -718,10 +709,10 @@ test!(update_publish_then_update {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] [..]
-{downloading} a v0.1.1 (registry file://[..])
+[DOWNLOADING] a v0.1.1 (registry file://[..])
 [COMPILING] a v0.1.1 (registry [..])
 [COMPILING] foo v0.5.0 ({dir})
-", downloading = DOWNLOADING,
+",
    dir = p.url())));
 
 });
@@ -746,8 +737,8 @@ test!(fetch_downloads {
                 execs().with_status(0)
                        .with_stdout(format!("\
 [UPDATING] registry `[..]`
-{downloading} a v0.1.0 (registry [..])
-", downloading = DOWNLOADING)));
+[DOWNLOADING] a v0.1.0 (registry [..])
+")));
 });
 
 test!(update_transitive_dependency {
@@ -782,11 +773,11 @@ test!(update_transitive_dependency {
     assert_that(p.cargo("build"),
                 execs().with_status(0)
                        .with_stdout(format!("\
-{downloading} b v0.1.1 (registry file://[..])
+[DOWNLOADING] b v0.1.1 (registry file://[..])
 [COMPILING] b v0.1.1 (registry [..])
 [COMPILING] a v0.1.0 (registry [..])
 [COMPILING] foo v0.5.0 ([..])
-", downloading = DOWNLOADING)));
+")));
 });
 
 test!(update_backtracking_ok {
@@ -870,11 +861,11 @@ test!(update_multiple_packages {
     assert_that(p.cargo("build"),
                 execs().with_status(0)
                        .with_stdout_contains(format!("\
-{downloading} a v0.1.1 (registry file://[..])", downloading = DOWNLOADING))
+[DOWNLOADING] a v0.1.1 (registry file://[..])"))
                        .with_stdout_contains(format!("\
-{downloading} b v0.1.1 (registry file://[..])", downloading = DOWNLOADING))
+[DOWNLOADING] b v0.1.1 (registry file://[..])"))
                        .with_stdout_contains(format!("\
-{downloading} c v0.1.1 (registry file://[..])", downloading = DOWNLOADING))
+[DOWNLOADING] c v0.1.1 (registry file://[..])"))
                        .with_stdout_contains(format!("\
 [COMPILING] a v0.1.1 (registry [..])"))
                        .with_stdout_contains(format!("\
@@ -993,10 +984,10 @@ test!(only_download_relevant {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stdout(&format!("\
 [UPDATING] registry `[..]`
-{downloading} baz v0.1.0 ([..])
+[DOWNLOADING] baz v0.1.0 ([..])
 [COMPILING] baz v0.1.0 ([..])
 [COMPILING] bar v0.5.0 ([..])
-", downloading = DOWNLOADING)));
+")));
 });
 
 test!(resolve_and_backtracking {
index e402de82f98f243527bced22081d90b9d6a545ea..ab64d7accbde51cc4cb25a962867a055d6c88982 100644 (file)
@@ -3,7 +3,6 @@ use std::io::prelude::*;
 use std::str;
 
 use support::{project, execs, basic_bin_manifest, basic_lib_manifest};
-use support::{DOCTEST};
 use support::paths::CargoPathExt;
 use hamcrest::{assert_that, existing_file, is_not};
 use cargo::util::process;
@@ -100,14 +99,14 @@ test test ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 [RUNNING] `rustdoc --test [..]lib.rs[..]`
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-", dir = p.url(), doctest = DOCTEST)));
+", dir = p.url())));
 });
 
 test!(cargo_test_verbose {
@@ -258,7 +257,7 @@ test lib_test ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 1 test
 test foo_0 ... ok
@@ -266,7 +265,7 @@ test foo_0 ... ok
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
 ",
-        p.url(), doctest = DOCTEST)))
+        p.url())))
 });
 
 test!(test_with_deep_lib_dep {
@@ -319,7 +318,7 @@ test bar_test ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} bar
+[DOCTEST] bar
 
 running 1 test
 test bar_0 ... ok
@@ -327,7 +326,6 @@ test bar_0 ... ok
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
 ",
-                       doctest = DOCTEST,
                        dir = p.url())));
 });
 
@@ -373,14 +371,14 @@ test external_test ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
 ",
-        p.url(), doctest = DOCTEST)))
+        p.url())))
 });
 
 test!(external_test_implicit {
@@ -421,13 +419,13 @@ test internal_test ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-", p.url(), doctest = DOCTEST)))
+", p.url())))
 });
 
 test!(dont_run_examples {
@@ -471,14 +469,13 @@ test bar ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
 ",
-                       doctest = DOCTEST,
                        dir = p.url())));
 
     assert_that(p.cargo("test").arg("foo"),
@@ -491,14 +488,13 @@ test foo ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-",
-                       doctest = DOCTEST)));
+")));
 });
 
 // Regression test for running cargo-test twice with
@@ -561,14 +557,14 @@ test [..] ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
 ",
-        p.url(), doctest = DOCTEST)))
+        p.url())))
 });
 
 test!(lib_with_standard_name {
@@ -613,15 +609,14 @@ test test ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} syntax
+[DOCTEST] syntax
 
 running 1 test
 test foo_0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-",
-                       doctest = DOCTEST, dir = p.url())));
+", dir = p.url())));
 });
 
 test!(lib_with_standard_name2 {
@@ -1007,14 +1002,13 @@ test foo ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
 ",
-                       doctest = DOCTEST,
                        dir = p.url())));
 
     assert_that(p.cargo("test"),
@@ -1027,14 +1021,13 @@ test foo ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-",
-                       doctest = DOCTEST)));
+")));
 });
 
 test!(test_then_build {
@@ -1061,14 +1054,13 @@ test foo ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
 ",
-                       doctest = DOCTEST,
                        dir = p.url())));
 
     assert_that(p.cargo("build"),
@@ -1443,14 +1435,13 @@ running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} d1
+[DOCTEST] d1
 
 running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-", dir = p.url(),
-   doctest = DOCTEST)));
+", dir = p.url())));
 });
 
 test!(example_bin_same_name {
@@ -1614,14 +1605,14 @@ running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 1 test
 test foo_0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", doctest = DOCTEST)))
+")))
 });
 
 test!(dashes_to_underscores {
@@ -1723,14 +1714,14 @@ test!(dylib_doctest {
     assert_that(p.cargo_process("test"),
                 execs().with_stdout(format!("\
 [COMPILING] foo v0.0.1 ([..])
-{doctest} foo
+[DOCTEST] foo
 
 running 1 test
 test foo_0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", doctest = DOCTEST)));
+")));
 });
 
 test!(dylib_doctest2 {
@@ -1796,14 +1787,14 @@ running 0 tests
 
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 1 test
 test _0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", doctest = DOCTEST)))
+")))
 });
 
 test!(dev_dep_with_build_script {
@@ -1898,14 +1889,14 @@ test sub_one_test ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-{doctest} foo
+[DOCTEST] foo
 
 running 1 test
 test sub_one_0 ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
-", doctest = DOCTEST)))
+")))
 });
 
 test!(test_multiple_packages {